import { Vue, Component } from 'vue-property-decorator'
const navData = [
    {
        title: '参观胸卡及联络信息',
        icon: 'iconrenyuan',
        path: '/personalInformation'
    }, {
        title: '产品兴趣及展商匹配',
        icon: 'iconpipeichanpin',
        path: '/questionnaire'
    }, {
        title: '参观登记确认',
        icon: 'iconqueren',
        path: '/visitorRegistration'
    }, {
        title: '确认函',
        icon: 'iconquerenhan',
        path: '/confirmation'
    },
    {
        title: '退出登录',
        icon: 'icontuichu',
        path: '/'
    }

]
@Component
export default class topNav extends Vue {
    private showMenu: boolean = false
    private showMenu1: boolean = false
    private cloumnShow: boolean = false
    private navData = navData
    hideMenu() {
        return new Promise((reslove: Function) => {
            this.showMenu1 = true
            setTimeout(() => {
                this.showMenu = false
                this.showMenu1 = false
                reslove()
            }, 280)

        })
    }
    goPath(path: string) {

        if (path === this.$route.path) return
        if (path === '/') {
            this.$dialog.alert({
                title: '提示',
                message: '确认退出登录当前账号吗？',
                showCancelButton: true
            }).then(() => {
                // on close
                console.log('退出')
                this.$store.commit('setUser', '')
                this.$toast('退出成功！')
                this.hideMenu().then(() => {
                    this.$router.push(path)
                })
            }).catch(() => { });

        } else {
            this.hideMenu().then(() => {
                this.$router.push(path)
            })
        }


    }

}